﻿Imports System.Data.OleDb

Public Class ThemHanhKhach
    Inherits DataProvider

    Public Function Check(ByVal cmnd As String) As Boolean
        Dim sql As String = "SELECT * FROM HanhKhach WHERE CMND='" + cmnd + "'"
        If GetDT(sql).Tables(0).Rows.Count() = 0 Then
            Return True
        End If
        Return False
    End Function

    Public Function save(ByVal dtohanhkhach As DTO.ThemHanhKhach) As Integer
        Dim sqo As String = "INSERT INTO HanhKhach(HoTen,DienThoai,CMND) VALUES('" + dtohanhkhach.hoten + "','" + dtohanhkhach.dienthoai + "','" + dtohanhkhach.cmnd + "')"
        Return Me.SaveData(sqo)
    End Function
End Class
